home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 1 / The Arsenal Files (Arsenal Computer).ISO / bbs / tm0401.txt < prev    next >
Text File  |  1994-01-23  |  5KB  |  132 lines

  1. SEA Technical Memorandum #0401, ARC 6.02; General Archive Format
  2. Last updated: April 27, 1989
  3. Copyright 1989 by System Enhancement Associates, Inc.
  4.  
  5.  
  6.  
  7.                                   ARC 6.02
  8.  
  9.                            General Archive Format
  10.  
  11.  
  12. The ARC file archive format, created by System Enhancement Associates in 
  13. March of 1985, has previously been documented primarily by the ARC sources 
  14. themselves.  The purpose of this document is to provide a separate overview 
  15. of the construction and format of an ARC format archive.  It is not our 
  16. intent to document the actual compression algorithms themselves in this 
  17. document.  Those remain defined by the ARC sources.
  18.  
  19.  
  20. An ARC format archive consists of one or more archive entries where each 
  21. entry begins with an "entry header".  This header is typically followed by 
  22. data that applies to the header.  In the usual case of a header that 
  23. identifies a compressed file, the data is the compressed file.
  24.  
  25. There are two general categories of entry headers, compressed files and 
  26. control information.  Every header without exception begins with an entry 
  27. header marker, which is a single byte with a value of 26 decimal (1A hex, 
  28. "control Z").  This marker byte is immediately followed by a one byte 
  29. "header type code" that identifies the format and type of the header which 
  30. follows.
  31.  
  32. The majority of all entry headers will be for "standard compressed files", 
  33. and will have the following format:
  34.  
  35.     Offset    Length    Description
  36.     ------    ------    -----------
  37.          0        13    Null-terminated filename
  38.         14         4    Size of the compressed data, in bytes
  39.         18         2    Creation date, in MS-DOS format
  40.         20         2    Creation time, in MS-DOS format
  41.         22         2    Cyclical redundancy check value (CRC)
  42.         24         4    True length of uncompressed file
  43.  
  44.  
  45. This is referred to in our documentation as a "standard header".  In almost 
  46. all cases an entry header is made to follow the format of a standard header 
  47. as much as possible.  At this time it is possible to treat any header that 
  48. is encountered as if it were a standard header, with two exceptions:
  49.  
  50.   * A type one header is an obsolete form of a type two header 
  51.     (uncompressed file), which is four bytes shorter.  A type one header 
  52.     may be converted to a type two header on input by (a) reading four 
  53.     bytes less than the full header size, and then (b) setting the size of 
  54.     the uncompressed file equal to the size of the compressed data.  
  55.  
  56.   * A type zero header marks the end of an archive, and has no header data.  
  57.     I.e. an archive will end with an archive marker byte followed by a zero 
  58.     byte.  
  59.  
  60.  
  61. Thus, the process for scanning through an ARC format archive picking out 
  62. entry headers may be summed up as follows:
  63.  
  64.  1) Read one byte for the archive entry marker.  If it's not an archive 
  65.     entry marker, then exit with an error condition.  
  66.  
  67.  2) Read one byte for the archive header type.
  68.  
  69.  3) If the entry type is zero, stop.
  70.  
  71.  4) If the entry type is one, read 24 bytes of header data.  Then set 
  72.     uncompressed size equal to compressed size.
  73.  
  74.  5) If the entry type is anything else, read 28 bytes of header data.
  75.  
  76.  6) Do whatever you had in mind with the header data.
  77.  
  78.  7) Perform a "relative seek" forward, skipping a number of bytes equal
  79.     to the compressed data size.  Return to step (1).
  80.  
  81.  
  82.  
  83. Header types twenty and up identify extended information, and are described 
  84. in TM0402, "ARC 6.02; Extended Data".  Standard compressed files are 
  85. identified as header types one through ninteen, as follows:
  86.  
  87.       Type    Compression method
  88.       ----    ------------------
  89.          1    No compression (short header)
  90.          2    No compression (standard header)
  91.          3    Repeated Character Compression
  92.          4    RCC followed by Huffman
  93.          5    12 bit Lempel-Ziv
  94.          6    RCC followed by 12 bit Lempel-Ziv
  95.          7    RCC followed by 12 bit Lempel-Ziv, alternate hash function
  96.          8    RCC followed by variable 12 bit Lempel-Ziv with dynamic reset
  97.          9    variable 13 bit Lempel-Ziv with dynamic reset (nonstandard)
  98.         10+   Reserved for future use
  99.  
  100.  
  101. These compression methods all have common names associated with them, as 
  102. follows:
  103.  
  104.       Type    Common name
  105.       ----    -----------
  106.          1    stored
  107.          2    Stored
  108.          3    Packed
  109.          4    Squeezed
  110.          5    crunched
  111.          6    crunched
  112.          7    crunched
  113.          8    Crunched
  114.          9    Deviant
  115.         10+   Other
  116.  
  117.  
  118.  
  119. Conclusion
  120. ==========
  121.  
  122. We hope that anyone seeking to work with ARC format archives finds this 
  123. information of use.  If we've left out anything you require, please feel 
  124. free to contact us.  We can be reached by voice between 9 AM and 5 PM 
  125. Eastern time at (201) 473-5153.  You can also leave a message for us on our 
  126. customer support bulletin board at (201) 473-1991.  This is a five-line 
  127. system that is available 24 hours a day at up to 2400 baud.  We can also be 
  128. reached by mail at: 
  129.  
  130.                     System Enhancement Associates, Inc.
  131.                        21 New Street, Wayne NJ  07470
  132.